Skip to content

Conversation

SteliosGee
Copy link
Contributor

I added 2 code snippets, one for finding the greatest common divisor (GCD) of two numbers using the Euclidean algorithm and a second one for finding the least common multiple (LCM) of two numbers.

Copy link

netlify bot commented Dec 30, 2024

Deploy Preview for quicksnip ready!

Name Link
🔨 Latest commit 4631a91
🔍 Latest deploy log https://app.netlify.com/sites/quicksnip/deploys/67729ab2b064e50008cb73b3
😎 Deploy Preview https://deploy-preview-25--quicksnip.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@Mathys-Gasnier Mathys-Gasnier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GDC is already available as a function of the math package in python, so I think it should this function instead of calculating the result itself.
For the LCM you can use x * y // gcd(x, y) which uses the gdc to calculate the lcm, it's a lot simpler.

Those a suggestion, feel free to ignore them if they dont fit what you want the snippets to look like

@SteliosGee
Copy link
Contributor Author

GDC is already available as a function of the math package in python, so I think it should this function instead of calculating the result itself. For the LCM you can use x * y // gcd(x, y) which uses the gdc to calculate the lcm, it's a lot simpler.

Those a suggestion, feel free to ignore them if they dont fit what you want the snippets to look like

You are right, i totally forgot. Instead i made some string manipulation snippets I will show on a new pull request.

@SteliosGee
Copy link
Contributor Author

Already built-in functions from the math packages

@SteliosGee SteliosGee closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants